<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePlayersTable extends Migration
{
    const TABLE = 'players';
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(self::TABLE, function (Blueprint $table) {
            $table->integer('id',true,true);
            $table->addColumn('string', 'openid', ['length' => 100,'default'=>'','comment'=>'用户唯一标识']);
            $table->addColumn('string', 'source', ['length' => 20,'default'=>'','comment'=>'用户来源']);
            $table->addColumn('string', 'username', ['length' => 100,'default'=>'','comment'=>'用户名']);
            $table->addColumn('string', 'nickname', ['length' => 100,'default'=>'','comment'=>'昵称']);
            $table->addColumn('string', 'tenant_id', ['length' => 20,'default'=>'','comment'=>'租户id']);
            $table->addColumn('string', 'avatar', ['length' => 200,'default'=>'','comment'=>'头像']);
            $table->addColumn('string','mobile',['length' => 11,'default'=>'','comment'=>'手机']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists(self::TABLE);
    }
}
